#pragma once
#include "HashTable.h"

namespace Unordered_Set
{
    template<class K>
    class unordered_set
    {
        struct SetKeyValueOf
        {
            const K& operator()(const K& data)
            {
                return data;
            }
        };
        typedef Opened_Hashing::HashTable<K,K,SetKeyValueOf> HashTable;
    public:
        typedef typename Opened_Hashing::HashTable<K,K,SetKeyValueOf>::const_iterator iterator;
        typedef typename Opened_Hashing::HashTable<K,K,SetKeyValueOf>::const_iterator const_iterator;
        pair<iterator,bool> insert(const K& data)
        {
            pair<typename Opened_Hashing::HashTable<K,K,SetKeyValueOf>::iterator,bool> it = _s.insert(data);
            return pair<iterator,bool>(it.first,it.second);
        }
        iterator begin()const
        {
            return _s.begin();
        }
        iterator end()const
        {
            return _s.end();
        }
    private:
        HashTable _s;
    };
};